package com.modernyuanshiren;

import java.util.Arrays;

public abstract class Abstract2DGame<T extends AbstractStatus<T, U>, U extends ISingleAction<T, U>>
		extends AbstractGame<T, U> {
	private GameMap map;
	
	public Abstract2DGame(Class<T> clazz) {
		super(clazz);
		map = new GameMap(Arrays.asList(getLegends()), getMapDatas());
	}
	
	public GameMap getMap() {
		return map;
	}

	/**
	 * -1 is for normal floor.
	 * 0,1,2... are mapped to getLegends()[0], getLegends()[1], getLegends()[2]...
	 * @return
	 * @see #getLegends()
	 */
	protected abstract int[][] getMapDatas(); 
	
	/**
	 * display names for datas in getMapDatas()'s array
	 * getLegends()[0] is for 0 in getMapDatas()'s array,
	 * getLegends()[1] is for 1 in getMapDatas()'s array,etc.
	 * @return
	 */
	protected abstract String[] getLegends();

}
